package com.kai.service.system.controller;

import com.kai.service.data.Result;
import com.kai.service.data.response.system.statistical.SevenDaysDataResponse;
import com.kai.service.data.response.system.statistical.SevenDaysModuleDataResponse;
import com.kai.service.data.response.system.statistical.TodayDataResponse;
import com.kai.service.system.service.ISystemLogService;
import com.kai.service.util.ResultResponseUtil;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/system")
@Tag(name = "系统日志")
public class SystemLogController {

    @Autowired
    private ISystemLogService systemLogService;

    /**
     * 统计当天数据
     *
     * @return
     */
    @GetMapping("/today/data")
    @Operation(summary = "统计当天数据")
    public Result<TodayDataResponse> todayData(){
        return ResultResponseUtil.success(systemLogService.todayData());
    }

    /**
     * 统计七天数据
     *
     * @return
     */
    @GetMapping("/seven/data")
    @Operation(summary = "统计七天数据")
    public Result<SevenDaysDataResponse> sevenDaysData(){
        return ResultResponseUtil.success(systemLogService.sevenDaysData());
    }

    /**
     * 统计七天模块数据
     *
     * @return
     */
    @GetMapping("/seven/module/data")
    @Operation(summary = "统计七天模块数据")
    public Result<SevenDaysModuleDataResponse> sevenDaysModuleData(){
        return ResultResponseUtil.success(systemLogService.sevenDaysModuleData());
    }
}
